package com.example.kuangelasticsearch.controller;

import com.example.kuangelasticsearch.utils.EsUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author lou ke
 * @since 2021/4/9 9:20
 */
@Slf4j
@RestController
public class Test {

    @Autowired
    EsUtils esUtils;

    @PostMapping(value = "/createIndex")
    public void createIndex() throws IOException {
        boolean result = esUtils.createIndex("kuang_index");
        log.info("创建索引：{}",result);
    }
}
